package bb.lanxing.lib.devices.ble.ble.characteristic.light;

import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;

public enum LightControlPointOpCode {
    requestControl((short)0),
    reset((short)1),
    setLigthType((short)2),
    setLightMode((short)3),
    setLightBeamMode((short)4),
    setLightFocus((short)5),
    setLightIntensity((short)6),
    setLightIntensityMode((short)7),
    setFallDetectionMode((short)8),
    responseCode((short)128),
    setupDFU((short)223),
    unknown((short)255);
    
    public static final Companion Companion = new Companion(null);
    private final short value;

    LightControlPointOpCode(short s) {
        this.value = s;
    }

    /*LightControlPointOpCode(int i) {
    }*/

    public final short getValue() {
        return this.value;
    }


    public static final class Companion {
        public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public LightControlPointOpCode from(byte b) {
            LightControlPointOpCode lightControlPointOpCode;
            LightControlPointOpCode[] values = LightControlPointOpCode.values();
            int length = values.length;
            int i = 0;
            while (true) {
                if (i >= length) {
                    lightControlPointOpCode = null;
                    break;
                }
                lightControlPointOpCode = values[i];
                if (((byte) lightControlPointOpCode.getValue()) == b) {
                    break;
                }
                i++;
            }
            return lightControlPointOpCode == null ? LightControlPointOpCode.unknown : lightControlPointOpCode;
        }
    }
}
